package cz.cvut.fit.web.nakupniSeznam.data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity (name = "user")
@NamedQueries({
	@NamedQuery(name="user.getAll", query="SELECT u FROM user u"),
	@NamedQuery(name="user.getByKey", query="SELECT u FROM user u WHERE u.key= :key")
})
public class User implements IEntity {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	private String key;

	@Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
}
